package com.weidey.blogWeb.mapper;

import com.weidey.blogWeb.domain.WebArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface WebArticleMapper {

    List<WebArticle> selectBlogArticleList();

    List<WebArticle> selectBlogArticleByGroup(@Param("groupId") int groupId);

    List<WebArticle> selectBlogArticleHot();

    WebArticle selectBlogArticleById(int id);

    void updateLikeaddCount(int id);

    void updateLikelessenCount(int id);

    void updateCollectLessenCount(int id);

    void updateCollectAddCount(int id);

    Integer selectLikeNum(int id);

    Integer selectCollectNum(int id);

    void updateOrInsertArticleRate(@Param("userId") Long userId,@Param("articleId") int articleId, @Param("rate")int rate);

    int selectRateSvg(int id);

    List<WebArticle> selectBlogArticleByAuthorId(@Param("userId") Long userId);

    List<WebArticle> selectArticleByStarArr(@Param("starArr") Long[] starArr);

    List<WebArticle> selectArticleByLikeArr(@Param("starArr")int[] starArr);

    void updateViews(Map<Long, Integer> viewsMap);
}
